{template aljbd:index_header}
{if $settings['templatepx']['value']}
	{template aljbd:footercss}
{/if}

<style type="text/css">
	.bdtr {
		 padding-left: 10px !important;
	}
</style>
<script charset="$_G['charset']" src="source/plugin/aljbd/js/editor/kindeditor-min.js" reload="true"></script>
<!--{if $_G['charset']=='gbk'}-->
<script charset="gbk" src="source/plugin/aljbd/js/editor/lang/zh_CN.js" reload="true"></script>
<!--{else}-->
<script charset="utf-8" src="source/plugin/aljbd/js/editor/lang/zh_CN_U8.js" reload="true"></script>
<!--{/if}-->
<script src="source/plugin/aljbd/js/editor/plugins/code/prettify.js" type="text/javascript"></script>  
<link href="source/plugin/aljbd/js/editor//plugins/code/prettify.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" reload="true">
        KindEditor.ready(function(K) {
              window.editor = KindEditor.create('#intro', {
					cssPath: 'source/plugin/aljbd/js/editor/plugins/code/prettify.css',
					resizeType : 1,
					allowPreviewEmoticons : false,
					allowImageUpload : true,
					items : [
						'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
        'superscript', 'clearhtml', 'quickformat', 'selectall', '/', 'fullscreen',
        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
        'table', 'hr', 'emoticons', 'pagebreak',
        'anchor', 'link', 'unlink']
				});
        });
		KindEditor.options.cssData = 'img { max-width:400px; }';
</script>
<div class="wp">
<div class="bm cl" id="pt">
<div class="z">
<a title="{$_G['setting']['bbname']}" class="nvhm" href="./">{$_G['setting']['bbname']}</a> <em>&rsquot;</em>
        <a href="plugin.php?id=aljbd">{$config['aljbd_plugins']}</a>
</div>
</div>
<div class="ct2_a wp cl" id="ct">
<div class="appl">
<div class="tbn">
<h2 class="mt bbda">{$config['aljbd_plugins']}</h2>
{template aljbd:mnav}
</div>
</div>
<iframe  name="formsubmit" style="display:none;"></iframe>
<div  style="float:left;">
<h1 class="ph mbm xi1" style="margin-left:10px;">{if $_GET['act']=='attend'}{lang aljbd:adddp_1}{else}{lang aljbd:adddp_2}{/if}</h1>
{if $config['money']&&$_GET['act']=='attend'}<div class="notice" style="border:1px dashed #f60;background-color:#FFC;color:red;margin-left:10px;font-size:13px;">{lang aljbd:adddp_3}{$config['money']}{$_G['setting']['extcredits'][$config['money_lx']]['title']}</div>{/if}
<form enctype="multipart/form-data" target="formsubmit"  action="plugin.php?id=aljbd&act={$_GET['act']}" autocomplete="off" id="addgoods_form" method="post">
 <input type="hidden" name="formhash" value="{FORMHASH}">
 <input type="hidden" name="bid" value="{$_GET['bid']}">
 <input type="hidden" name="compress" value="" id="compress">
 <input type="hidden" name="aljbd_token" value="{eval echo create_token('aljbd_token');}">
 {eval $sign=DB::result_first("select sign from ".DB::table('aljbd_attestation')." where sign=1 and bid=".intval($_GET['bid']))}
  <table cellspacing="0" cellpadding="0" class="tfm">
      <tbody>
          <tr>
              <th class="bdtr"><span style="color:red;">*</span>{lang aljbd:s230}</th>
				<td>
					{if $_GET['act']=='attend'}<input type="text" name="name" class="px" value="{$bd['name']}" >{else}{if $sign}{$bd['name']}&nbsp;<font color="red">{lang aljbd:aedit_23}</font><input type="hidden" name="name" value="{$bd['name']}">{else}<input type="text" name="name" class="px" value="{$bd['name']}" >{/if}{/if}
				</td>
              <td>&nbsp;</td>
          </tr>
		  <tr>
				<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s231}</td>
				<td><input type="text" name="tel" class="px" value="{$bd['tel']}" ></td>
		  </tr>
		  <tr>
    				<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s232}</td>
    				<td colspan="4"><span id="logo"><input type="file" name="logo" id="logo" style="width:220px;" onchange="lrz_mobile('logo',this)"></span><font color="red">{lang aljbd:s233} &#23567;&#20110;{$config['img_size']}&#75;&#66;&#30340;&#22270;&#29255;</font></td>
                </tr>

				<tr>
				<td class="bdtr"></td><td colspan="4"><span id="img_logo">{if $bd['logo']}<img src="$bd['logo']" width="100px" height="100px">{/if}</span></td>
				</tr>
				<tr>
    				<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s234}</td>
    				<td colspan="4"><input type="text" name="addr" class="px" style="width:350px;" value="{$bd['addr']}"></td>
                </tr>
		  <tr>
			<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s223}</td>
				<td colspan="4">
					<select name="type" id="type" style="width:120px;" data-id="1" onchange="getregion(this,'brand')">
						<option value="">{lang aljbd:s224}</option>
						<!--{loop $typelist $typeid $type}-->
						<option value="$typeid" {if $typeid==$bd['type']}selected{/if}>$type['subject']</option>
						<!--{/loop}-->
					</select>
					&nbsp;&nbsp;&nbsp;
					<span name="subtype" id="subtype">
					{if $bd['subtype']}
					<select name="subtype" id="type" style="width:120px;" onchange="getregion(this,'brand')">
						<!--{loop C::t('#aljbd#aljbd_type')->fetch_all_by_upid($bd['type']) $typeid $type}-->
						<option value="$typeid" {if $typeid==$bd['subtype']}selected{/if}>$type['subject']</option>
						<!--{/loop}-->
					</select>
					{/if}
					</span>
					<span id="subtype3">
					{if $bd['subtype3']}
					<select name="subtype3" style="width:120px;">
						<!--{loop C::t('#aljbd#aljbd_type')->fetch_all_by_upid($bd['subtype']) $typeid $type}-->
						<option value="$typeid" {if $typeid==$bd['subtype3']}selected{/if}>$type['subject']</option>
						<!--{/loop}-->
					</select>
					{/if}

				    </span>
				</td>
			</tr>
			<script type="text/javascript">
			function getregion(t,u){
				var url ='';
				if(u !='u'){
					var name = 'subtype3';
					if(jq(t).attr('data-id') == 1){
						var name = 'subtype';
					}
				}else{
					var name = 'region1';
					if(jq(t).attr('data-id') == 1){
						var name = 'subregion';
					}
				}
				if(u){
					url = '&type='+u; 
				}
				
				var str = '<select name="'+name+'" onchange="getregion(this,\''+u+'\')" style="width:120px;"><option value="">\u8bf7\u9009\u62e9</option>';
				jq.post('plugin.php?id=$pluginid&act=linkage&upid='+jq(t).val()+url,function(data){
					if(data){
						jq.each(data,function(k,d){
						str+='<option value="'+k+'">'+d+'</option>';
						});
						str+='</select>';
						jq(t).next().remove();
						jq(t).after(str);
					}
					
				}, "json");
			}
			</script>
		<tr>
						<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s16}</td>
    				<td colspan="4">
						<select name="region" id="region" style="width:120px;" data-id="1" onchange="getregion(this,'u')">
							<option value="">{lang aljbd:s17}</option>
							<!--{loop $rlist $rid $r}-->
							<option value="$rid" {if $rid==$bd['region']}selected{/if}>$r['name']</option>
							<!--{/loop}-->
						</select>
						&nbsp;&nbsp;&nbsp;
						<span name="subregion" id="subregion">
						{if $bd['subregion']}
						<select name="subregion" style="width:120px;" onchange="getregion(this,'u')">
						<!--{loop C::t('#aljbd#aljbd_region')->fetch_all_by_upid('','',$bd['region']) $rid $r}-->
						<option value="$rid" {if $rid==$bd['subregion']}selected{/if}>$r['name']</option>
						<!--{/loop}-->
						</select>
						{/if}
						</span>
						<span name="region1" id="region1">
						{if $bd['region1']}
						<select name="region1" style="width:120px;">
						<!--{loop C::t('#aljbd#aljbd_region')->fetch_all_by_upid('','',$bd['subregion']) $rid $r}-->
						<option value="$rid" {if $rid==$bd['region1']}selected{/if}>$r['name']</option>
						<!--{/loop}-->
						</select>
						{/if}
						</span>
					</td>
				</tr>
		
				<tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>{lang aljbd:qq}</td>
				<td colspan="4">
					
					<input type="text" name="qq" class="pt"   value="{$bd['qq']}">
					
				</td>
				</tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>&#26106;&#26106;&#21495;&#65306;</td>
				<td colspan="4">
					
					<input type="text" name="wangwang" class="pt"   value="{$bd['wangwang']}">
					
				</td>
				</tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>&#24494;&#20449;&#21495;&#65306;</td>
				<td colspan="4">
					
					<input type="text" name="weixin_id" class="pt"   value="{$bd['weixin_id']}">
					
				</td>
				</tr>
				<tr>
				<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:dianping_1}</td>
				<td colspan="4">
				{loop $businesstypearr $k $v}
					<input type=checkbox name=businesstype[] onClick="countChoices(this)" value="$k" {if in_array($k,explode(',',$bd['businesstype']))}checked{/if}>$v
				{/loop}
					&nbsp;&nbsp;<span style="color:red;">{lang aljbd:dianping_2}</span>
				</td>
				</tr>
				{if !$settings['brand_wurl']['value']}
				<tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>{lang aljbd:wurl_1}</td>
				<td colspan="4">
					
					<input type="text" name="wurl" class="pt" id="replymessage" style="background:#FFF;" value="{$bd['wurl']}">&nbsp;{lang aljbd:wurl_2}
					
				</td>
				
				</tr>
				{/if}
				{if file_exists("source/plugin/dcdz/dcdz.inc.php")}
					{template dcdz:urlarray}
				{/if}
				<tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>{lang aljbd:s244}</td>
				<td colspan="4">
					
					<input type="text" name="other" class="pt"  value="{$bd['other']}">
					
				</td>
				</tr>
				<tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>{lang aljbd:business_hours}</td>
				<td colspan="4">
					
					<input type="text" name="business_hours" class="pt"  value="{$bd['business_hours']}">
					
				</td>
				</tr>
				<tr>
				<td class="bdtr"><span style="color:red;">&nbsp;&nbsp;</span>{lang aljbd:bus_routes}</td>
				<td colspan="4">
					
					<input type="text" name="bus_routes" class="pt"  value="{$bd['bus_routes']}">
					
				</td>
				</tr>
				{if !file_exists('source/plugin/aljbd/com/intro.php')}
		<tr>
		<td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s18}</td>
		<td colspan="4">
			
			<div class="tedt" style="width:100%;">
			<div class="bar">
			<div class="fpd">
			<a href="javascript:;" title="{lang aljbd:s19}" class="fbld" onclick="seditor_insertunit('reply', '[b]', '[/b]');doane(event);">B</a>
			<a fwin="apply" href="javascript:;" title="{lang aljbd:s20}" class="fclr" id="replyforecolor" onclick="showColorBox(this.id, 2, 'reply');doane(event);" initialized="true">Color</a>
			<a fwin="apply" id="replyimg" href="javascript:;" title="{lang aljbd:s21}" class="fmg" onclick="seditor_menu('reply', 'img');doane(event);">Image</a>
			<a fwin="apply" id="replyurl" href="javascript:;" title="{lang aljbd:s22}" class="flnk" onclick="seditor_menu('reply', 'url');doane(event);">Link</a>
			</div></div>
			<div class="area" style="background:#FFF;">
			<textarea fwin="apply" rows="3" name="intro" class="pt" id="replymessage" style="background:#FFF;">{if $bd['intro']}{$bd['intro']}{else}$config['yushe']{/if}</textarea>
			</div>
			</div>
		</td>
		</tr>
		{else}
		<tr><td class="bdtr"><span style="color:red;">*</span>{lang aljbd:s18}</td><td><textarea name="intro"  id="intro" style="height:500px;">{if $bd['intro']}{$bd['intro']}{else}{eval echo str_replace ("\r\n", "<br/>", $config['yushe']);}{/if}</textarea></td></tr>
		{/if}
		{if $settings['is_agreement']['value']==1}
		<tr><td class="bdtr"><span style="color:red;">&nbsp;</span>&nbsp;</td><td><input type="checkbox" name="agreement" value=1 {if $_GET['act'] == 'edit'}checked="checked"{/if}>{eval echo htmlspecialchars_decode($settings['agreement']['value'])}</td></tr>
		{/if}
		<tr>
              <th></th>
              <td colspan="2"><button  class="pn pnc vm"  value="true" id="submit" name="submit" type="submit" onClick="javascript:checkhHtml5();"><strong>{lang aljbd:s289}</strong></button></td>
          </tr>
      </tbody>
  </table>
  </form>
</div></div></div>
<SCRIPT LANGUAGE="JavaScript"> 

function countChoices(obj) 
{	
	var inputs = document.getElementsByName("businesstype[]");

	var checked_counts = 0;

	for(var i=0;i<inputs.length;i++){
		if(inputs[i].checked){
			checked_counts++;
		}
	}
	max = 3; 
	if (checked_counts > max) { 
		alert("{lang aljbd:dianping_3}" + max + "{lang aljbd:dianping_4}"); 
		obj.checked = false; 
	} 
}
 
</script>
{template aljbd:img_js}
{template common/footer}